package demo.xml;

import demo.xml.bean.ConsumerComponent;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.Scanner;

/**
 * @author m0v1
 * @date 2021年09月21日 10:46 上午
 */
public class ConsumerApplication {
    public static void main(String[] args) {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("dubbo-comsumer.xml");
        context.start();

        ConsumerComponent consumerComponent = context.getBean(ConsumerComponent.class);
        while (true) {
            System.out.println("please enter a name:");
            Scanner scanner = new Scanner(System.in);
            String name = scanner.nextLine();
            consumerComponent.sayHello2Name(name);
        }


    }
}
